package juc;

import lombok.extern.slf4j.Slf4j;

import static java.lang.Thread.sleep;

//这里要加c，因为在logback.xml中配置了只有name为c的才能启用debug等级的日志
@Slf4j(topic = "c.Test01")
public class Test01 {
    static int r = 0;
    public static void main(String[] args) throws InterruptedException {
        test1();
    }

    private static void test1() throws InterruptedException{
        log.info("开始");
        log.debug("开始debug");
        Thread t1 = new Thread(() -> {
            log.debug("开始d1");
            try {
                sleep(1);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            r  = 10;
        });
        t1.start();
        log.info("结果为：{}",r);
        log.info("结束");
    }
}
